<!DOCTYPE html>
<html lang="en">

{include file='Public:head'}

<body data-type="widgets">
<script src="/assets/js/theme.js"></script>
<div class="am-g tpl-g">
    {include file='Public:header'}
    {include file='Public:menu2'}
    <!-- 内容区域 -->
    <div class="tpl-content-wrapper">
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title  am-cf">品牌列表</div>

                        </div>
                        <div class="widget-body  am-fr">
                            <form action="{:Url('Brand/BrandSearch')}" class="am-form am-form-inline" method="post">
                                <div class="am-form-group"  >
                                    <label  class="am-u-sm am-form-label">名称</label>
                                    <div class="am-u-sm" >
                                        <input type="text" id="name" name="name" placeholder="搜索词" style="width:200px;margin-left:40px;margin-top:-30px;" value="">
                                    </div>
                                    <div class="am-u-sm">
                                    <button type="submit" class="am-btn am-btn-secondary" style="width:80px;margin-left:255px;margin-top:-60px;">筛选</button>
                                    </div >
                                    </div>
                            </form>
                            <div class="am-form-group" >
                                <div class="am-btn-toolbar" >
                                    <div class="am-btn-group am-btn-group-xs" style="float: right;">
                                        <a href="{:Url('Brand/BrandAdd')}" class="am-btn am-btn-secondary" style="height:37px;line-height:25px;margin-top:-58px; "><span class="am-icon-plus" ></span> 添加品牌</a>
                                    </div>
                                </div>
                            </div>
                            <div class="am-u-sm-12">
                                <table  class="am-table am-table-compact am-table-striped tpl-table-black " id="example-r">
                                    <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>品牌名称</th>
                                        <th>Logo</th>
                                        <th>品牌分类</th>
                                        <th>排序</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                     {foreach $list as $k=>$v}
                                    <tr class="gradeX">
                                        <td>{$v.id}</td>
                                        <td>{$v.name}</td>
                                        <td><img src="{$v.logo}" width="60px" height="60px"></td>
                                        <td>{$v.cat_name}</td>
                                        <td>{$v.order}</td>
                                        <td>
                                            <div class="tpl-table-black-operation">
                                                <a href="{:Url('Brand/BrandEdit',array('id'=>$v.id))}" class="btn btn-primary" title="编辑"><i class="fa fa-pencil"></i></a>
                                                <a href="javascript:void(0);" onclick="shan('{$v.id}') " class="btn btn-danger" title="删除"><i class="fa fa-trash-o"></i></a>

                                            </div>
                                        </td>

                                    </tr>
                                    {/foreach}
                                    <!-- more data -->
                                    </tbody>
                                </table>
                            </div>
                            <div class="am-u-lg-12 am-cf">

                                <div class="am-fr">
                                    {$list->render()}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<script src="http://cdn.bootcss.com/amazeui/2.7.2/js/amazeui.min.js"></script>
<script src="/assets/js/amazeui.datatables.min.js"></script>
<script src="/assets/js/dataTables.responsive.min.js"></script>
<script src="/assets/js/app.js"></script>

</body>
<script style="text/javascript">
    function shan(id){
        $.post("{:url('Brand/BrandDelete')}",{id:id},function (res) {
            if(res.code ==200){
                alert(res.msg);
                location.reload();
            }else{
                alert(res.msg);
            }
        });

    }

</script>
</html>